class UserMailer < ActionMailer::Base
  default from: Rails.application.secrets.email_provider_username

  

   #default from: 'notifications@example.com'
 
  def welcome_email(user)

  	delivery_options = { user_name: Rails.application.secrets.email_provider_username,
                         password: Rails.application.secrets.email_provider_password,
                         address: Rails.application.secrets.email_provider_address }

    @user = user
    @url  = 'http://example.com/login'
    mail(to: @user.email, subject: 'Welcome to My Awesome Site',delivery_method_options: delivery_options)
  end


  def hi(user)
  	 @user = user
  	 mail(to: @user.email, subject: "hi #{user.name}")
  end

end
